<?php
/* @var $this SuratMasukController */
/* @var $model SuratMasuk */

$this->breadcrumbs=array(
	'Surat Masuk'=>array('index'),
	'Create',
);
?>

<?php
/* @var $this SuratMasukController */
/* @var $model SuratMasuk */
/* @var $form CActiveForm */
?>
<?php $this->beginWidget('ext.widgets.XPanel', array('title' => 'Surat Masuks', 'width' => 900,'height' => 500)); 
?>
<div class="form">

<?php $form=$this->beginWidget('ext.CAxActiveForm', array(
	'id'=>'surat-masuk-form',
	'enableAjaxValidation'=>false,
         'htmlOptions' => array(
             'enctype' => 'multipart/form-data'
             ),
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
    <table class="ma-table">
        <tbody>
	<tr>
		<td class="labelfield" style="width:200px">
                    <?php echo $form->labelEx($model,'id_instansi'); ?>
                </td>
		<td>
                    <?php 
                    echo CHtml::textField(
                            'instansi', 
                            $model->Instansi->nama,
                            array(
                                'readonly' => 'readonly'
                            )
                            );
                    echo CHtml::HiddenField('id_instansi'); 
                    
                    ?>
                </td>
		<td>
                    <?php echo $form->error($model,'id_instansi'); ?>
                </td>
	</tr>
        <tr>
		<td class="labelfield" style="width:200px">
                    <?php echo $form->labelEx($model,'id_pegawai'); ?>
                </td>
		<td>
                    <?php
                    
                    echo CHtml::textField(
                            'instansi', 
                            $model->Pegawai->nama,
                            array(
                                'readonly' => 'readonly'
                            )
                            );
                    
                    echo CHtml::activeHiddenField($model,'id_pegawai'); 
                    
                    ?>
                </td>
		<td>
                    <?php echo $form->error($model,'id_pegawai'); ?>
                </td>
	</tr>
	<tr>
		<td class="labelfield" style="width:200px">
                    <?php echo $form->labelEx($model,'no_surat'); ?>
                </td>
		<td>
                    <?php echo CHtml::activeTextField($model,'no_surat'); ?>
                </td>
		<td>
                    <?php echo $form->error($model,'no_surat'); ?>
                </td>
	</tr>

	<tr>
		<td class="labelfield" style="width:200px">
                    <?php echo $form->labelEx($model,'info_penyimpanan'); ?>
                </td>
		<td>
                    <?php echo CHtml::activeTextArea($model,'info_penyimpanan'); ?>
                </td>
		<td>
                    <?php echo $form->error($model,'info_penyimpanan'); ?>
                </td>
	</tr>
        
        
	<tr>
		<td class="labelfield" style="width:200px">
                    <?php echo $form->labelEx($model,'keterangan'); ?>
                </td>
		<td>
                    <?php echo CHtml::activeTextArea($model,'keterangan'); ?>
                </td>
		<td>
                    <?php echo $form->error($model,'keterangan'); ?>
                </td>
	</tr>
        
	<tr>
		<td class="labelfield" style="width:200px">
                    <?php echo $form->labelEx($model,'tanggal_masuk'); ?>
                </td>
		<td>
                    <?php
                     $this->widget(
                                'ext.jui.EJuiDateTimePicker',
                                array(
                                    'model'     => $model,
                                    'attribute' => 'tanggal_masuk',
                                    'language'=> 'en',//default Yii::app()->language
                                    'mode'    => 'date',//'datetime' or 'time' ('datetime' default)
                                    'options'   => array(
                                        'dateFormat' => 'yy-mm-dd',
                                        'timeFormat' => 'hh:mm tt',//'hh:mm tt' default
                                    ),
                                    'htmlOptions'=>array(
                                        'placeholder'=>'Tanggal'
                                    )
                                )
                            );

                    ?>
                </td>
		<td>
                    <?php echo $form->error($model,'tanggal_masuk'); ?>
                </td>
	</tr>
        
        <tr>
		<td class="labelfield" style="width:200px">
                    <?php echo $form->labelEx($model,'tanggal_diterima'); ?>
                </td>
		<td>
                    <?php
                     $this->widget(
                                'ext.jui.EJuiDateTimePicker',
                                array(
                                    'model'     => $model,
                                    'attribute' => 'tanggal_diterima',
                                    'language'=> 'en',//default Yii::app()->language
                                    'mode'    => 'date',//'datetime' or 'time' ('datetime' default)
                                    'options'   => array(
                                        'dateFormat' => 'yy-mm-dd',
                                        'timeFormat' => 'hh:mm tt',//'hh:mm tt' default
                                    ),
                                    'htmlOptions'=>array(
                                        'placeholder'=>'Tanggal'
                                    )
                                )
                            );

                    ?>
                </td>
		<td>
                    <?php echo $form->error($model,'tanggal_diterima'); ?>
                </td>
	</tr>
	
	<tr>
		<td></td>
                <td><?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('class'=>'ax-btn')); ?>
</td>
                <td></td>
	</tr>
        </tbody>
    </table>
<?php $this->endWidget(); ?>

</div><!-- form -->
<?php $this->endWidget(); ?>